#ifndef BROADCAST_H
#define BROADCAST_H

#include <string>

namespace Controller {

  enum Language
  {
    LANGUAGE_CHINA = 0,
    LANGUAGE_USA
  };

  enum BroadcastType
  {
    BROADCAST_TYPE_NULL = 0,
    BROADCAST_TYPE_ONSHOW_ATTACKS,
    BROADCAST_TYPE_CURRENT_ATTACK,
    BROADCAST_TYPE_ATTACK_STAT,
    BROADCAST_TYPE_ARP_ALL_ADDRESS,
    BROADCAST_TYPE_SYN_ALL_ADDRESS,
    BROADCAST_TYPE_SMURF_ALL_ADDRESS,
    BROADCAST_TYPE_CHANGE_BACKGROUND,
    BROADCAST_TYPE_CHANGE_LANGUAGE,
    BROADCAST_TYPE_SUBITEM_ANIMATE_STOP,
    BROADCAST_TYPE_SELECTBG_ANIMATE_STOP,
    BROADCAST_TYPE_WRITE_BACK,
    BROADCAST_TYPE_EXIT
  };
  
  enum BroadcastAttribute
  {
    BROADCAST_ATTRIBUTE_READ_ONLY = 0,
    BROADCAST_ATTRIBUTE_READ_WRITE
  };

  class Broadcast
  {

    friend class PostManager;

  private:
    BroadcastType broadcastType;
    BroadcastAttribute broadcastAttribute;
    std::string signal;

    bool boolData;
    std::string stringData;
    int intData;
    double doubleData;

    bool SetAttribute(BroadcastAttribute newBroadcastAttribute);

  public:
    Broadcast();
    ~Broadcast();

    bool SetBoolData(bool data);
    bool SetStringData(std::string data);
    bool SetIntData(int data);
    bool SetDoubleData(double data);
    bool SetBroadcastType(BroadcastType newBroadcastType);
    
    bool GetBoolData();
    std::string GetStringData();
    int GetIntData();
    double GetDoubleData();
    BroadcastType GetBroadcastType(){ return broadcastType;}
    bool ReadOnly() { return BROADCAST_ATTRIBUTE_READ_ONLY == broadcastAttribute ; }
  };

}

#endif
